<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .ceng{
            width: 260px;
            height: 200px;
            border:1px solid black;
            background-image:linear-gradient(to left,orange 100px,green 160px,red 260px);/*从左到右渐变*/
            /*background-image:linear-gradient(180deg,orange 100px,green 160px,red 260px); 从上到下渐变*/
        }
    </style>
</head>
<body>
   <div class="ceng"></div>
</body>
</html>